import request from '@/utils/request'
// 状态修改
export function changeUserStatus (newsId, opStatus) {
  const data = {
    newsId,
    opStatus
  }
  return request({
    url: '/manage/news/changeStatus',
    method: 'put',
    data: data
  })
}
// 查询资讯列表
export function listNews (query) {
  return request({
    url: '/manage/news/list',
    method: 'get',
    params: query
  })
}

// 查询资讯详细
export function getNews (newsId) {
  return request({
    url: '/manage/news/' + newsId,
    method: 'get'
  })
}

// 新增资讯
export function addNews (data) {
  return request({
    url: '/manage/news',
    method: 'post',
    data: data
  })
}

// 修改资讯
export function updateNews (data) {
  return request({
    url: '/manage/news',
    method: 'put',
    data: data
  })
}

// 删除资讯
export function delNews (newsId) {
  return request({
    url: '/manage/news/' + newsId,
    method: 'delete'
  })
}
